-
-
Notifications
You must be signed in to change notification settings - Fork 28.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactor handling of exposed entities for cloud Alexa and Google #89877
Conversation
Hey there @home-assistant/cloud, mind taking a look at this pull request as it has been labeled with an integration ( Code owner commandsCode owners of
|
Hey there @home-assistant/core, mind taking a look at this pull request as it has been labeled with an integration ( Code owner commandsCode owners of
|
entity_id, assistant, assistant_options | ||
) | ||
for listener in self._listeners.get(assistant, []): | ||
listener() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we pass in the changed info ? Alexa for example can update individual entities.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alexa has logic to work out which entities were changed, I think that's still needed since updates are batched.
81f4353
to
aa9798e
Compare
@websocket_api.require_admin | ||
@websocket_api.websocket_command( | ||
{ | ||
vol.Required("type"): "homeassistant/expose_new_entities/set", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do you think that we should keep this a bit more generic as set_options
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure. The only other option today is 2fa override for Google which also stores data in entity options but has its own API.
It's a bit strange that exposed_entities
knows about other options, that's why I kept it separated.
We can unify if it grows beyond that maybe?
Proposed change
Refactor handling of exposed entities for cloud Alexa and Google assistant:
homeassistant/expose_new_entities
with{"assistant":"cloud.alexa", "expose_new": True}
homeassistant/expose_entity
with{"assistant":"cloud.alexa", "entity_id": "blah.blah", "should_expose": True}
Type of change
Additional information
Checklist
black --fast homeassistant tests
)If user exposed functionality or configuration variables are added/changed:
If the code communicates with devices, web services, or third-party tools:
Updated and included derived files by running:
python3 -m script.hassfest
.requirements_all.txt
.Updated by running
python3 -m script.gen_requirements_all
..coveragerc
.To help with the load of incoming pull requests: